home *** CD-ROM | disk | FTP | other *** search
/ PC Format (PL) 2013 August / PC_Format_082013.iso / pene wersje / website x5 home 10 / wsx5_home.exe / {app} / Res / Admin / guestbook.php < prev    next >
PHP Script  |  2013-04-08  |  1KB  |  43 lines

  1. <?php
  2. require_once("header.php");
  3.  
  4. $id = isset($_GET['id']) ? $_GET['id'] : "";
  5.  
  6. // If there's only one guestbook just show it and don't ask for more
  7. if ($id == "" && count($imSettings['guestbooks']) < 2)
  8. {
  9.     $keys = array_keys($imSettings['guestbooks']);
  10.     $id = $imSettings['guestbooks'][$keys[0]]['id'];
  11. }
  12. ?>
  13. <div id="imAdminPage">
  14.     <div id="imBody">
  15.         <div class="imContent">
  16.              <?php if (count($imSettings['guestbooks']) > 1): // Select a guestbook?>
  17.                  <script type="text/javascript">
  18.                      function showGb( obj ) {
  19.                          var val = $( obj ).val();
  20.                          if (val !== "")
  21.                              window.top.location.href = "guestbook.php?id=" + val;
  22.                          else
  23.                              window.top.location.href = "guestbook.php";
  24.                      }
  25.                  </script>
  26.                 <select onchange="showGb(this)" style="width: 100%;">
  27.                     <option value=""><?php echo l10n("admin_guestbook_select", "Select a guestbook") ?></option>
  28. <?php foreach($imSettings['guestbooks'] as $gbid => $gb): ?>
  29.                     <option value="<?php echo $gbid?>"<?php echo ($gbid == $id ? " selected" : "") ?>><?php echo $gb['pagetitle'] . " - " . (strlen($gb['celltitle']) ? $gb['celltitle'] : $gbid) ?></option>
  30. <?php endforeach; ?>
  31.                 </select>
  32. <?php endif; 
  33. if ($id != ""):
  34. // Show the comments of a guestbook ?>
  35.               <div class="imBlogPostComment">
  36.  <?php
  37. endif; ?>
  38.             </div>
  39.         </div>
  40.     </div>
  41. </div>
  42. <?php require_once("footer.php"); ?>
  43.